tools/ocaml/libs/xc fix gcc-8 format-truncation warning
authorJohn Thomson <git@johnthomson.fastmail.com.au>
Tue, 15 May 2018 01:48:43 +0000 (11:48 +1000)
committerWei Liu <wei.liu2@citrix.com>
Wed, 16 May 2018 08:19:21 +0000 (09:19 +0100)
commit2adc90908fbb1e614c477e29f2d45eda94570795
tree94545350ec549c982c9374419b866fbe64b5cb40
parentb953322c5772dbc537421f9e2f97026a1c2fcb2e
tools/ocaml/libs/xc fix gcc-8 format-truncation warning

 CC       xenctrl_stubs.o
xenctrl_stubs.c: In function 'failwith_xc':
xenctrl_stubs.c:65:17: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
      "%d: %s: %s", error->code,
                 ^
xenctrl_stubs.c:64:4: note: 'snprintf' output 6 or more bytes (assuming 1029) into a destination of size 1028
    snprintf(error_str, sizeof(error_str),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "%d: %s: %s", error->code,
      ~~~~~~~~~~~~~~~~~~~~~~~~~~
      xc_error_code_to_desc(error->code),
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      error->message);
      ~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[8]: *** [/build/xen-git/src/xen/tools/ocaml/libs/xc/../../Makefile.rules:37: xenctrl_stubs.o] Error 1
m

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
tools/ocaml/libs/xc/xenctrl_stubs.c